import {
 	Admin,
 	NotFound,
	Perssion
 } from '@pages'
 import Loading from '@pages/Loading'
 import Loadable from 'react-loadable'
 import {
 	PieChartOutlined,
 	UnorderedListOutlined,
 	SettingOutlined,
	MessageOutlined
 } from '@ant-design/icons'
 // 一级路由  默认显示的 不需要权限的
 const baseRoutes = [{
 		path: '/login',
 		component: Loadable({
 			loader: () => import('@pages/Login'),
 			loading: Loading,
 		})
 	},
 	{
 		path: '/admin',
 		component: Admin
 	},
 	{
 		path: '/404',
 		component: NotFound
 	},
 ]

 // 需要权限  二级路由

 const adminRoutes = [{
 		path: '/admin/dashBoard',
 		name: '仪表盘',
 		component: Loadable({
 			loader: () => import('@pages/DashBoard'),
 			loading: Loading,
 		}),
 		icon: PieChartOutlined,
 		meta: {
 			isNav: true,
			roles:['admin','edit','superAdmin']
 		}
 	},
 	{
 		path: '/admin/artList',
 		name: '文章列表',
 		component: Loadable({
 			loader: () => import('@pages/ArtList'),
 			loading: Loading,
 		}),
 		icon: UnorderedListOutlined,
 		meta: {
 			isNav: true,
			roles:['admin','edit','superAdmin']
 		}
 	},
 	{
 		path: '/admin/artEdit/:id',
 		name: '文章编辑',
 		component: Loadable({
 			loader: () => import('@pages/ArtEdit'),
 			loading: Loading,
 		}),
 		meta: {
 			isNav: false,
			roles:['admin','edit','superAdmin']
 		}
 	},
 	{
 		path: '/admin/artAdd',
 		name: '添加文章',
 		component: Loadable({
 			loader: () => import('@pages/ArtAdd'),
 			loading: Loading,
 		}),
 		meta: {
 			isNav: false,
			roles:['admin','edit','superAdmin']
 		}
 	},
 	
	{
		path: '/admin/message',
		name: '消息中心',
		icon: MessageOutlined,
		component: Loadable({
			loader: () => import('@pages/Message'),
			loading: Loading,
		}),
		meta: {
			isNav: true,
			roles:['admin','edit','superAdmin']
		}
	},
	{
		path: '/admin/settings',
		name: '设置',
		icon: SettingOutlined,
		component: Loadable({
			loader: () => import('@pages/Settings'),
			loading: Loading,
		}),
		meta: {
			isNav: true,
			roles:['admin','edit','superAdmin']
		}
	},
 	{
 		path: "/admin/404",
 		name: "找不到",
 		component: NotFound,
 		meta: {
 			isNav: false,
			roles:['edit','superAdmin','admin']
 		}
 	},
	{
		path: "/admin/noPerssion",
		name: "没有权限",
		component: Perssion,
		meta: {
			isNav: false,
			roles:['edit','superAdmin','admin']
		}
	}
 ]

 export {
 	baseRoutes,
 	adminRoutes
 }
